Integrate Zenoh#2362
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
b66e833 to
f8d2d42
Compare
Greptile SummaryThis PR integrates Zenoh as a second transport backend alongside LCM, making it the platform default on macOS. The implementation adds
Confidence Score: 4/5Safe to merge with the caveat that the DDSTransport race between broadcast/stop (flagged in a previous review thread) remains unresolved in this diff. The Zenoh integration is well-structured and the new code does not introduce equivalent gaps — ZenohTransport uses _start_lock properly and the session pool never closes mid-publish. The unresolved DDSTransport broadcast/stop race from a prior thread is the primary concern. dimos/core/transport.py (DDSTransport.broadcast/subscribe still unguarded by _start_lock) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Process Start] --> B{DIMOS_TRANSPORT or --transport flag?}
B -- set --> C[apply_transport_arg / global_config.update]
B -- not set --> D{platform.system?}
D -- Darwin --> E[transport = zenoh]
D -- Linux --> F[transport = lcm]
C --> G[global_config.transport resolved]
E --> G
F --> G
G --> H[make_transport name msg_type]
H --> I{transport == zenoh?}
I -- yes typed --> J[ZenohTransport dimos/name/pkg.Msg]
I -- yes pickled --> K[pZenohTransport dimos/name]
I -- no typed --> L[LCMTransport /name]
I -- no pickled --> M[pLCMTransport /name]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Process Start] --> B{DIMOS_TRANSPORT or --transport flag?}
B -- set --> C[apply_transport_arg / global_config.update]
B -- not set --> D{platform.system?}
D -- Darwin --> E[transport = zenoh]
D -- Linux --> F[transport = lcm]
C --> G[global_config.transport resolved]
E --> G
F --> G
G --> H[make_transport name msg_type]
H --> I{transport == zenoh?}
I -- yes typed --> J[ZenohTransport dimos/name/pkg.Msg]
I -- yes pickled --> K[pZenohTransport dimos/name]
I -- no typed --> L[LCMTransport /name]
I -- no pickled --> M[pLCMTransport /name]
Reviews (5): Last reviewed commit: "integrate zenoh" | Re-trigger Greptile |
0afc3a9 to
4472fc9
Compare
| def make_transport( | ||
| name: str, msg_type: type | None = None, *, g: GlobalConfig = global_config | ||
| ) -> PubSubTransport[Any]: | ||
| """Construct the active-backend pub/sub transport for a logical channel. |
There was a problem hiding this comment.
Few things, Transport isn't neccessarily a PubSubTransport - we can use TCP and IP address as a setting here etc (in theory, haven't implemented)
in case of PubSubTransport, a string doesn't define a full topic, there is a reason why Topic for LCM and Zenoh is a different object. Zenoh offers QoS settings etc per channel. maybe specific router config etc.
So I'm thinking when global switch zenoh or LCM is used, for lcm that can literally be just LCM(topic_string) but zenoh probably wants reliable delivery for RPC specifically or specific per topic configuration (Image can be unreliable, but not agent messages)
I'm not sure right now what to suggest here - if we can normalize transport requirements across topics "this is reliable", "this is unreliable" or if we need per transport global blueprint config overlay that this global config switch just applies? global overlay seems better to me
| return Topic(topic=topic) | ||
|
|
||
|
|
||
| class ZenohRPC(PubSubRPCMixin[Topic, Any], PickleZenoh): |
There was a problem hiding this comment.
We can do this initially, but Zenoh actually supports RPC on their protocol level, so we dont need to piggyback to pubsub here.
eab7ba7 to
ee8cb1f
Compare
96fead3 to
719fd0b
Compare
4866c9c to
925fb38
Compare
39e3e4c to
32849cf
Compare
Problem
We need to support Zenoh as well.
Closes DIM-955
Solution
How to Test
Run a blueprint with Zenoh communication:
Start
humancli, also with Zenoh:Contributor License Agreement